import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
import { HelloIonicPage } from '../pages/hello-ionic/hello-ionic';
// import { ItemDetailsPage } from '../pages/item-details/item-details';
// import { ListPage } from '../pages/list/list';
import { DiscoverModule } from '../discover/discover.module';
import { ListPage } from '../discover/list/list';
import { DetailPage } from '../discover/detail/detail';


let routes: any = [
      { component: HelloIonicPage, name: 'hello', segment: 'hello' },
      { component: ListPage, name: 'discoverList', segment: 'discoverList' , defaultHistory: [HelloIonicPage]},
      { component: DetailPage, name: 'discoverDetail', segment: 'discoverDetail/:id',defaultHistory: [ListPage] }
    ];

@NgModule({
  declarations: [
    MyApp,
    HelloIonicPage,
    // ItemDetailsPage,
    // ListPage
  ],
  imports: [
    IonicModule.forRoot(MyApp ,{}, {
     links: routes
  }) ,
    DiscoverModule
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HelloIonicPage,
    // ItemDetailsPage,
    // ListPage
  ],
  providers: [{provide: ErrorHandler, useClass: IonicErrorHandler}]
})
export class AppModule {}
